
package com.bj58.disconf.web.service.user.service.impl;

import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bj58.disconf.web.service.user.dto.Visitor;
import com.bj58.disconf.web.service.user.service.UserInnerMgr;
import com.bj58.ub.common.commons.ThreadContext;
import com.google.gson.Gson;
import com.google.inject.Singleton;

/**
 * @author knightliao
 */
@Singleton
public class UserInnerMgrImpl implements UserInnerMgr {

    protected static final Logger LOG = LoggerFactory.getLogger(UserInnerMgrImpl.class);

    @Override
    public Visitor getVisitor(Long userId) {
        if (userId == null || userId <= 0) {
            LOG.error("userId is null or <= 0, return null");
            return null;
        }
        return null;
    }

    /**
     * 
     */
    @Override
    public Set<Long> getVisitorAppIds() {
        Visitor visitor = ThreadContext.getSessionVisitor();
        LOG.info("get visitor:" + new Gson().toJson(visitor));
        return visitor.getAppIds();
    }
}
